# encoding: utf-8
from flask_marshmallow import base_fields
from app.modules.common.parameters import BaseParameters


class AgentListParameters(BaseParameters):
    agent_id = base_fields.String(
        description = "ucloud-agent ID",
        required = False,
        missing = None
    )
    is_only_free = base_fields.Boolean(
        description = "是否只显示闲置agent",
        required = False,
        missing = None
    )


class AgentUpdateParameters(BaseParameters):
    agent_id = base_fields.String(
        description = "ucloud-agent ID",
        required = True,
    )
    # record_id = base_fields.Integer(
    #     description = "申请记录id",
    #     required = False,
    #     missing = None
    # )
    load_level = base_fields.Integer(
        description = "负载级别id",
        required = True,
    )
    machine_ip = base_fields.String(
        description = "实体机ip",
        required = True,
    )
    vm_id = base_fields.String(
        description = "虚拟机id",
        required = True,
    )
    # expect_recover_date = base_fields.DateTime(
    #     description = "回收日期",
    #     required = False,
    #     missing = None
    # )


class AgentStParameters(BaseParameters):
    agent_id = base_fields.String(
        description = "ucloud-agent ID",
        required = True,
    )


class AgentAddParameters(BaseParameters):
    ip = base_fields.String(
        description = "agent ip",
        required = True,
    )
    load_level = base_fields.Integer(
        description = "负载级别id",
        required = True,
    )
    machine_ip = base_fields.String(
        description = "实体机ip",
        required = True,
    )
    vm_id = base_fields.String(
        description = "虚拟机id",
        required = True,
    )
